package service;

import dao.PatientDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pojo.Patient;

import java.util.List;

@Service
public class PatientServiceImpl implements PatientService {
    @Autowired
    private PatientDAO dao;
    @Transactional
    public void PatientAdd(Patient patient) {
dao.save(patient);
    }

    @Override
    public List<Patient> queryByCard(String idCard) {
        return dao.queryByCard(idCard);
    }

    @Override
    public Patient queryPat(Integer id) {
        return dao.queryById(id);
    }

}
